<template>
  <div id="teTitle" :style="{ width: Width, height: Height }">
    <div id="none"></div>
    <div id="text">
      <slot name="titleText"></slot>
    </div>
    <div id="tool">
      <div class="box close">
        <div class="icon" @click="onClose()">
          <svg
            t="1579242531737"
            viewBox="0 0 1024 1024"
            version="1.1"
            xmlns="http://www.w3.org/2000/svg"
            p-id="3769"
            width="22"
            height="22"
          >
            <path
              d="M583.168 523.776L958.464 148.48c18.944-18.944 18.944-50.176 0-69.12l-2.048-2.048c-18.944-18.944-50.176-18.944-69.12 0L512 453.12 136.704 77.312c-18.944-18.944-50.176-18.944-69.12 0l-2.048 2.048c-19.456 18.944-19.456 50.176 0 69.12l375.296 375.296L65.536 899.072c-18.944 18.944-18.944 50.176 0 69.12l2.048 2.048c18.944 18.944 50.176 18.944 69.12 0L512 594.944 887.296 970.24c18.944 18.944 50.176 18.944 69.12 0l2.048-2.048c18.944-18.944 18.944-50.176 0-69.12L583.168 523.776z"
              p-id="3770"
              fill="#fbfbf7"
            ></path>
          </svg>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'teTitle',
    methods: {
      onClose() {
        this.$emit('TeDialogCloseEvent', true);
      }
    },
    props: {
      Width: {
        type: String,
        default: '100%'
      },
      Height: {
        type: String,
        default: '7.5%'
      }
    }
  };
</script>

<style scoped>
  #teTitle {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    background: rgb(41, 64, 128);
    user-select: none;
    max-height: 37.5px;
  }
  #none {
    width: 30%;
    height: 100%;
  }
  #text {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 40%;
    height: 100%;
    font-size: 1.2em;
    color: rgb(238, 238, 238);
  }
  #tool {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    width: 30%;
    height: 100%;
  }
  #tool .box {
    width: 37.5px;
    height: 100%;
    min-width: 16px;
    min-height: 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .icon {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  .icon:hover {
    background: rgb(41, 41, 41);
    cursor: pointer;
  }
  .close .icon:hover {
    background: rgb(255, 41, 41);
  }
</style>
